import { defHttp } from '@/utils/http/axios'
import { GetAccountInfoModel } from '../../demo/model/accountModel'

enum Api {
  GET_ELECTRICITY_ELETYPEALLREPORT = '/chart/dict/eleTypeAllReport',
  GET_ELECTRICITY_ELETYPEALLREPORTSYSTEM = '/chart/dict/eleTypeAllReportSystem',
  GET_ELECTRICITY_eleTypeRatioClassify = '/chart/dict/eleTypeRatioClassify',
  GET_ELECTRICITY_eleTypeClassify = '/chart/dict/eleTypeClassify',
  GET_ELECTRICITY_ELETYPEALLREPORTBUILDING = '/chart/dict/eleTypeAllReportBuilding',
  GET_BY_PARENT_BY_DICT = '/classify/getByParentByDict',
  GET_BY_PARENT_BY_DICT_AND_DATA_TYPEID = '/classify/getByParentByDictAndDataTypeId',
  
  GET_ELECTRICITY_ELETYPEONEREPORT = '/chart/dict/eleTypeOneReport',
  GET_ELECTRICITY_ELETYPEONEREPORTBUILDING = '/chart/dict/eleTypeOneReportBuilding',
  GET_ELECTRICITY_THISDATA = '/chart/dict/thisData',
  GET_ELECTRICITY_THISDATAUNITCONSUMPTION = '/chart/dict/thisDataUnitConsumption',
  GET_ELECTRICITY_CHILDDATA = '/chart/dict/childData',
  GET_ELECTRICITY_CHILDDATA_INFO = '/chart/dict/compareCodeAndInfo',

  GET_ELECTRICITY_COMPAREBARCHARTELE = '/electric/compareBarChartEle',
  GET_ELECTRICITY_ALL_REPORT_SYSTEM_RATIO = '/chart/dict/eleTypeAllReportSysRatio',
  GET_ELECTRICITY_ALL_REPORT_SYSTEM_TAB2 = '/chart/dict/eleTypeAllReportSys',
  EXPORT_ELECTRICITY_SHEETS = '/chart/dict/export',
  GET_ZIECE_DATA = '/zieceData/getZieceData',
  MODIFY_GROUP_VAL_DATA = '/group/data/modifyGroupValData',
  GET_ELECTRICITY_EXCEL_DATA = '/group/data/getExcelDataEle',
  EXPORT_ELECTRICITY_EXCEL_DATA = '/group/data/exportExcelBaseEle',
}

//电科-各科室汇总-汇总统计
export const getEleTypeAllReport = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_ELETYPEALLREPORT, params })
}
//电科-各科室汇总-各系统总电量
export const getEleTypeAllReportSystem = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_ELETYPEALLREPORTSYSTEM,
    params,
  })
}
//电科-电耗占比饼图
export const getEleTypeRatioClassify = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_eleTypeRatioClassify,
    params,
  })
}
//电科-电耗占比饼图
export const getEleTypeClassify = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_eleTypeClassify,
    params,
  })
}
//电科-各科室汇总-楼栋
export const getEleTypeAllReportBuilding = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_ELETYPEALLREPORTBUILDING,
    params,
  })
}

//电科-各科室分项

//分类
export const getByParentByDict = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_BY_PARENT_BY_DICT, params })
}
export const getByParentByDictAndDataTypeId = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_BY_PARENT_BY_DICT_AND_DATA_TYPEID, params })
}

// 列表
export const getEleTypeOneReport = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_ELETYPEONEREPORT, params })
}
// 总计
export const getEleTypeOneReportBuilding = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_ELETYPEONEREPORTBUILDING,
    params,
  })
}

//电科-年度用量及单耗
export const getEleThisData = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_THISDATA, params })
}
//电科-分厂用量
export const getEleChildData = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_CHILDDATA, params })
}
export const getEleChildDatainfo = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_CHILDDATA_INFO, params })
}

//电科-峰平谷电耗统计
export const getCompareBarChartEle = (params) => {
  return defHttp.get<GetAccountInfoModel>({ url: Api.GET_ELECTRICITY_COMPAREBARCHARTELE, params })
}
//电科-峰平谷电耗统计
export const getAllReportSystemRatio = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_ALL_REPORT_SYSTEM_RATIO,
    params,
  })
}
export const getAllReportSystem2 = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_ALL_REPORT_SYSTEM_TAB2,
    params,
  })
}
export const exportTableData = (params) => {
  return defHttp.get<GetAccountInfoModel>({
    url: Api.EXPORT_ELECTRICITY_SHEETS,
    params,
    responseType: 'blob',
  })
}

export const thisDataUnitConsumption = (params) => {
  //生产区域照明单耗 办公区域照明单耗
  return defHttp.get<GetAccountInfoModel>({
    url: Api.GET_ELECTRICITY_THISDATAUNITCONSUMPTION,
    params,
  })
}

export const getZieceData = (params) => {
  return defHttp.get({
    url: Api.GET_ZIECE_DATA,
    params,
  })
}

export const modifyGroupValData = (data) => defHttp.post({url: Api.MODIFY_GROUP_VAL_DATA, data})
export const getElExcelData = (params) => defHttp.get({url: Api.GET_ELECTRICITY_EXCEL_DATA, params})
export const exportElExcelData = (params) => defHttp.get({url: Api.EXPORT_ELECTRICITY_EXCEL_DATA, params, responseType: 'blob'})
export const getChartVoYoY = (params) => defHttp.get({url: '/electric/getChartVoYoY', params})
export const getChartVoMoM = (params) => defHttp.get({url: '/electric/getChartVoMoM', params})